<!-- src/components/PlayerList.vue -->
<template>
  <div>
    <ul class="player-list">
      <li v-for="player in players" :key="player.id" class="player-item">
        {{ player.name }} (房间: {{ player.roomId }})
      </li>
    </ul>
  </div>
</template>

<script setup>
import { defineProps } from 'vue';

const props = defineProps({
  players: {
    type: Array,
    required: true,
  },
});
</script>

<style scoped>
.player-list {
  list-style: none;
  padding: 0;
}

.player-item {
  padding: 10px;
  border: 1px solid #ccc;
  margin: 5px 0;
  background-color: #f9f9f9;
  border-radius: 5px;
}
</style>
